#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os

def list_files(startpath):
    print("完整的文件列表：")
    for root, dirs, files in os.walk(startpath):
        level = root.replace(startpath, '').count(os.sep)
        indent = ' ' * 4 * level
        print(f'{indent}{os.path.basename(root)}/')
        subindent = ' ' * 4 * (level + 1)
        for f in files:
            print(f'{subindent}{f}')

if __name__ == "__main__":
    list_files('.') 